# Maintainer: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
# Contributor: dibblethewrecker <dibblethewrecker@jiwe.org>

pkgname=osdbattery
pkgver=1.4
pkgrel=8
pkgdesc="Displays battery information in the OSD style"
arch=('loong64' 'x86_64')
url="http://osdbattery.sourceforge.net/"
license=('GPL2')
depends=('xosd')
makedepends=('patch')
install=$pkgname.install
source=(https://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}_${pkgver}.tar.gz
        sysfs.patch showbatt)
sha256sums=('b1f775c746cd78b6aa7fc9ee75ecf2806ef3da93a42dd806c0414dcae55aed9f'
            'd7a00e918929d36aaf3eb398649ea070ed6c4840e3da2407226fc5d9ae15d776'
            '69969053235642315b49fe6ea5df7f8c391befbf492fd4ff71afbf4d438333b2')

build() {
  cd ${srcdir}/${pkgname}_${pkgver}
  
  patch -i ${srcdir}/sysfs.patch

  make
}

package() {
  cd ${srcdir}/${pkgname}_${pkgver}

  install -D -m755 $pkgname ${pkgdir}/usr/bin/${pkgname}
  install -D -m755 ${srcdir}/showbatt ${pkgdir}/usr/bin/showbatt
  install -D -m644 $pkgname.cfg ${pkgdir}/etc/${pkgname}/${pkgname}.cfg
}
